Optimal. Leaf size=281 \[ \frac {2 B (b c-a d) (-a d g-b c g+2 b d f) \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{b^2 d^2}-\frac {(b f-a g)^2 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{2 b^2 g}-\frac {2 B g (a+b x) (b c-a d) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{b^2 d}+\frac {(f+g x)^2 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{2 g}+\frac {4 B^2 (b c-a d) (-a d g-b c g+2 b d f) \text {Li}_2\left (\frac {d (a+b x)}{b (c+d x)}\right )}{b^2 d^2}+\frac {4 B^2 g (b c-a d)^2 \log (c+d x)}{b^2 d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.96, antiderivative size = 450, normalized size of antiderivative = 1.60, number of steps used = 25, number of rules used = 12, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.414, Rules used = {2525, 12, 2528, 2486, 31, 2524, 2418, 2390, 2301, 2394, 2393, 2391} \[ -\frac {4 B^2 (b f-a g)^2 \text {PolyLog}\left (2,-\frac {d (a+b x)}{b c-a d}\right )}{b^2 g}-\frac {4 B^2 (d f-c g)^2 \text {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )}{d^2 g}-\frac {2 B (b f-a g)^2 \log (a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{b^2 g}+\frac {2 B (d f-c g)^2 \log (c+d x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{d^2 g}+\frac {(f+g x)^2 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2}{2 g}-\frac {2 A B g x (b c-a d)}{b d}+\frac {4 B^2 g (b c-a d)^2 \log (c+d x)}{b^2 d^2}-\frac {2 B^2 g (a+b x) (b c-a d) \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b^2 d}-\frac {4 B^2 (b f-a g)^2 \log (a+b x) \log \left (\frac {b (c+d x)}{b c-a d}\right )}{b^2 g}+\frac {2 B^2 (b f-a g)^2 \log ^2(a+b x)}{b^2 g}-\frac {4 B^2 (d f-c g)^2 \log (c+d x) \log \left (-\frac {d (a+b x)}{b c-a d}\right )}{d^2 g}+\frac {2 B^2 (d f-c g)^2 \log ^2(c+d x)}{d^2 g} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 31
Rule 2301
Rule 2390
Rule 2391
Rule 2393
Rule 2394
Rule 2418
Rule 2486
Rule 2524
Rule 2525
Rule 2528
Rubi steps
\begin {align*} \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2 \, dx &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}-\frac {B \int \frac {2 (b c-a d) (f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{(a+b x) (c+d x)} \, dx}{g}\\ &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}-\frac {(2 B (b c-a d)) \int \frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{(a+b x) (c+d x)} \, dx}{g}\\ &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}-\frac {(2 B (b c-a d)) \int \left (\frac {g^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b d}+\frac {(b f-a g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b (b c-a d) (a+b x)}+\frac {(d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{d (-b c+a d) (c+d x)}\right ) \, dx}{g}\\ &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}-\frac {(2 B (b c-a d) g) \int \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx}{b d}-\frac {\left (2 B (b f-a g)^2\right ) \int \frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{a+b x} \, dx}{b g}+\frac {\left (2 B (d f-c g)^2\right ) \int \frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{c+d x} \, dx}{d g}\\ &=-\frac {2 A B (b c-a d) g x}{b d}-\frac {2 B (b f-a g)^2 \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}+\frac {2 B (d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \log (c+d x)}{d^2 g}-\frac {\left (2 B^2 (b c-a d) g\right ) \int \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right ) \, dx}{b d}+\frac {\left (2 B^2 (b f-a g)^2\right ) \int \frac {(c+d x)^2 \left (-\frac {2 d e (a+b x)^2}{(c+d x)^3}+\frac {2 b e (a+b x)}{(c+d x)^2}\right ) \log (a+b x)}{e (a+b x)^2} \, dx}{b^2 g}-\frac {\left (2 B^2 (d f-c g)^2\right ) \int \frac {(c+d x)^2 \left (-\frac {2 d e (a+b x)^2}{(c+d x)^3}+\frac {2 b e (a+b x)}{(c+d x)^2}\right ) \log (c+d x)}{e (a+b x)^2} \, dx}{d^2 g}\\ &=-\frac {2 A B (b c-a d) g x}{b d}-\frac {2 B^2 (b c-a d) g (a+b x) \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b^2 d}-\frac {2 B (b f-a g)^2 \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}+\frac {2 B (d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \log (c+d x)}{d^2 g}+\frac {\left (4 B^2 (b c-a d)^2 g\right ) \int \frac {1}{c+d x} \, dx}{b^2 d}+\frac {\left (2 B^2 (b f-a g)^2\right ) \int \frac {(c+d x)^2 \left (-\frac {2 d e (a+b x)^2}{(c+d x)^3}+\frac {2 b e (a+b x)}{(c+d x)^2}\right ) \log (a+b x)}{(a+b x)^2} \, dx}{b^2 e g}-\frac {\left (2 B^2 (d f-c g)^2\right ) \int \frac {(c+d x)^2 \left (-\frac {2 d e (a+b x)^2}{(c+d x)^3}+\frac {2 b e (a+b x)}{(c+d x)^2}\right ) \log (c+d x)}{(a+b x)^2} \, dx}{d^2 e g}\\ &=-\frac {2 A B (b c-a d) g x}{b d}-\frac {2 B^2 (b c-a d) g (a+b x) \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b^2 d}-\frac {2 B (b f-a g)^2 \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}+\frac {4 B^2 (b c-a d)^2 g \log (c+d x)}{b^2 d^2}+\frac {2 B (d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \log (c+d x)}{d^2 g}+\frac {\left (2 B^2 (b f-a g)^2\right ) \int \left (\frac {2 b e \log (a+b x)}{a+b x}-\frac {2 d e \log (a+b x)}{c+d x}\right ) \, dx}{b^2 e g}-\frac {\left (2 B^2 (d f-c g)^2\right ) \int \left (\frac {2 b e \log (c+d x)}{a+b x}-\frac {2 d e \log (c+d x)}{c+d x}\right ) \, dx}{d^2 e g}\\ &=-\frac {2 A B (b c-a d) g x}{b d}-\frac {2 B^2 (b c-a d) g (a+b x) \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b^2 d}-\frac {2 B (b f-a g)^2 \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}+\frac {4 B^2 (b c-a d)^2 g \log (c+d x)}{b^2 d^2}+\frac {2 B (d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \log (c+d x)}{d^2 g}+\frac {\left (4 B^2 (b f-a g)^2\right ) \int \frac {\log (a+b x)}{a+b x} \, dx}{b g}-\frac {\left (4 B^2 d (b f-a g)^2\right ) \int \frac {\log (a+b x)}{c+d x} \, dx}{b^2 g}-\frac {\left (4 b B^2 (d f-c g)^2\right ) \int \frac {\log (c+d x)}{a+b x} \, dx}{d^2 g}+\frac {\left (4 B^2 (d f-c g)^2\right ) \int \frac {\log (c+d x)}{c+d x} \, dx}{d g}\\ &=-\frac {2 A B (b c-a d) g x}{b d}-\frac {2 B^2 (b c-a d) g (a+b x) \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b^2 d}-\frac {2 B (b f-a g)^2 \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}+\frac {4 B^2 (b c-a d)^2 g \log (c+d x)}{b^2 d^2}-\frac {4 B^2 (d f-c g)^2 \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{d^2 g}+\frac {2 B (d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \log (c+d x)}{d^2 g}-\frac {4 B^2 (b f-a g)^2 \log (a+b x) \log \left (\frac {b (c+d x)}{b c-a d}\right )}{b^2 g}+\frac {\left (4 B^2 (b f-a g)^2\right ) \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,a+b x\right )}{b^2 g}+\frac {\left (4 B^2 (b f-a g)^2\right ) \int \frac {\log \left (\frac {b (c+d x)}{b c-a d}\right )}{a+b x} \, dx}{b g}+\frac {\left (4 B^2 (d f-c g)^2\right ) \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,c+d x\right )}{d^2 g}+\frac {\left (4 B^2 (d f-c g)^2\right ) \int \frac {\log \left (\frac {d (a+b x)}{-b c+a d}\right )}{c+d x} \, dx}{d g}\\ &=-\frac {2 A B (b c-a d) g x}{b d}+\frac {2 B^2 (b f-a g)^2 \log ^2(a+b x)}{b^2 g}-\frac {2 B^2 (b c-a d) g (a+b x) \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b^2 d}-\frac {2 B (b f-a g)^2 \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}+\frac {4 B^2 (b c-a d)^2 g \log (c+d x)}{b^2 d^2}-\frac {4 B^2 (d f-c g)^2 \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{d^2 g}+\frac {2 B (d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \log (c+d x)}{d^2 g}+\frac {2 B^2 (d f-c g)^2 \log ^2(c+d x)}{d^2 g}-\frac {4 B^2 (b f-a g)^2 \log (a+b x) \log \left (\frac {b (c+d x)}{b c-a d}\right )}{b^2 g}+\frac {\left (4 B^2 (b f-a g)^2\right ) \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {d x}{b c-a d}\right )}{x} \, dx,x,a+b x\right )}{b^2 g}+\frac {\left (4 B^2 (d f-c g)^2\right ) \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {b x}{-b c+a d}\right )}{x} \, dx,x,c+d x\right )}{d^2 g}\\ &=-\frac {2 A B (b c-a d) g x}{b d}+\frac {2 B^2 (b f-a g)^2 \log ^2(a+b x)}{b^2 g}-\frac {2 B^2 (b c-a d) g (a+b x) \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b^2 d}-\frac {2 B (b f-a g)^2 \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )^2}{2 g}+\frac {4 B^2 (b c-a d)^2 g \log (c+d x)}{b^2 d^2}-\frac {4 B^2 (d f-c g)^2 \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{d^2 g}+\frac {2 B (d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \log (c+d x)}{d^2 g}+\frac {2 B^2 (d f-c g)^2 \log ^2(c+d x)}{d^2 g}-\frac {4 B^2 (b f-a g)^2 \log (a+b x) \log \left (\frac {b (c+d x)}{b c-a d}\right )}{b^2 g}-\frac {4 B^2 (b f-a g)^2 \text {Li}_2\left (-\frac {d (a+b x)}{b c-a d}\right )}{b^2 g}-\frac {4 B^2 (d f-c g)^2 \text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )}{d^2 g}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.31, size = 351, normalized size = 1.25 \[ \frac {(f+g x)^2 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )^2-\frac {4 B \left (-b^2 (d f-c g)^2 \log (c+d x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )+d^2 (b f-a g)^2 \log (a+b x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )+A b d g^2 x (b c-a d)+b^2 B (d f-c g)^2 \left (2 \text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )+\log (c+d x) \left (2 \log \left (\frac {d (a+b x)}{a d-b c}\right )-\log (c+d x)\right )\right )-B d^2 (b f-a g)^2 \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \text {Li}_2\left (\frac {d (a+b x)}{a d-b c}\right )\right )+B d g^2 (a+b x) (b c-a d) \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )-2 B g^2 (b c-a d)^2 \log (c+d x)\right )}{b^2 d^2}}{2 g} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.74, size = 0, normalized size = 0.00 \[ {\rm integral}\left (A^{2} g x + A^{2} f + {\left (B^{2} g x + B^{2} f\right )} \log \left (\frac {b^{2} e x^{2} + 2 \, a b e x + a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )^{2} + 2 \, {\left (A B g x + A B f\right )} \log \left (\frac {b^{2} e x^{2} + 2 \, a b e x + a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ), x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (g x + f\right )} {\left (B \log \left (\frac {{\left (b x + a\right )}^{2} e}{{\left (d x + c\right )}^{2}}\right ) + A\right )}^{2}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.01, size = 0, normalized size = 0.00 \[ \int \left (g x +f \right ) \left (B \ln \left (\frac {\left (b x +a \right )^{2} e}{\left (d x +c \right )^{2}}\right )+A \right )^{2}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.55, size = 786, normalized size = 2.80 \[ \frac {1}{2} \, A^{2} g x^{2} + 2 \, {\left (x \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) + \frac {2 \, a \log \left (b x + a\right )}{b} - \frac {2 \, c \log \left (d x + c\right )}{d}\right )} A B f + {\left (x^{2} \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) - \frac {2 \, a^{2} \log \left (b x + a\right )}{b^{2}} + \frac {2 \, c^{2} \log \left (d x + c\right )}{d^{2}} - \frac {2 \, {\left (b c - a d\right )} x}{b d}\right )} A B g + A^{2} f x - \frac {2 \, {\left (2 \, a c d g + {\left (2 \, c d f \log \relax (e) - {\left (g \log \relax (e) + 2 \, g\right )} c^{2}\right )} b\right )} B^{2} \log \left (d x + c\right )}{b d^{2}} + \frac {4 \, {\left (2 \, a b d^{2} f - a^{2} d^{2} g - {\left (2 \, c d f - c^{2} g\right )} b^{2}\right )} {\left (\log \left (b x + a\right ) \log \left (\frac {b d x + a d}{b c - a d} + 1\right ) + {\rm Li}_2\left (-\frac {b d x + a d}{b c - a d}\right )\right )} B^{2}}{b^{2} d^{2}} + \frac {B^{2} b^{2} d^{2} g x^{2} \log \relax (e)^{2} + 2 \, {\left (2 \, a b d^{2} g \log \relax (e) + {\left (d^{2} f \log \relax (e)^{2} - 2 \, c d g \log \relax (e)\right )} b^{2}\right )} B^{2} x + 4 \, {\left (B^{2} b^{2} d^{2} g x^{2} + 2 \, B^{2} b^{2} d^{2} f x + {\left (2 \, a b d^{2} f - a^{2} d^{2} g\right )} B^{2}\right )} \log \left (b x + a\right )^{2} + 4 \, {\left (B^{2} b^{2} d^{2} g x^{2} + 2 \, B^{2} b^{2} d^{2} f x + {\left (2 \, c d f - c^{2} g\right )} B^{2} b^{2}\right )} \log \left (d x + c\right )^{2} + 4 \, {\left (B^{2} b^{2} d^{2} g x^{2} \log \relax (e) + 2 \, {\left (a b d^{2} g + {\left (d^{2} f \log \relax (e) - c d g\right )} b^{2}\right )} B^{2} x - {\left ({\left (g \log \relax (e) - 2 \, g\right )} a^{2} d^{2} - 2 \, {\left (d^{2} f \log \relax (e) - c d g\right )} a b\right )} B^{2}\right )} \log \left (b x + a\right ) - 4 \, {\left (B^{2} b^{2} d^{2} g x^{2} \log \relax (e) + 2 \, {\left (a b d^{2} g + {\left (d^{2} f \log \relax (e) - c d g\right )} b^{2}\right )} B^{2} x + 2 \, {\left (B^{2} b^{2} d^{2} g x^{2} + 2 \, B^{2} b^{2} d^{2} f x + {\left (2 \, a b d^{2} f - a^{2} d^{2} g\right )} B^{2}\right )} \log \left (b x + a\right )\right )} \log \left (d x + c\right )}{2 \, b^{2} d^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \left (f+g\,x\right )\,{\left (A+B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^2}\right )\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________